<?php
    include('./library/conn.php');
    $search=$_REQUEST['search'];
    if($search){
        $select="select id,search from product where search like '%$search%'";
        $arr=array();
        $res=$mysqli->query($select);
        if($res->num_rows>0){
            while($row=$res->fetch_assoc()){
                array_push($arr,$row);
            };
        }
        echo json_encode($arr);
    }else{
        echo '';
    }
    
    $mysqli->close();
    die();
?>